package com.xiangdao.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;


public class ShareProduct {

    private Integer id;

    private Double price;   //共享价钱

    private String title;  //标题

    private String message; //回复

    private User user;

    private Date time;  //共享时间

    private Integer userId;//用户id

    private Integer messageNum;

    private String image;

    public ShareProduct(Integer id, Double price, String title, String message, User user, Date time, Integer userId, Integer messageNum, String image) {
        this.id = id;
        this.price = price;
        this.title = title;
        this.message = message;
        this.user = user;
        this.time = time;
        this.userId = userId;
        this.messageNum = messageNum;
        this.image = image;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getMessageNum() {
        return messageNum;
    }

    public void setMessageNum(Integer messageNum) {
        this.messageNum = messageNum;
    }

    public ShareProduct(Integer id, Double price, String title, String message, User user, Date time, Integer userId, Integer messageNum) {
        this.id = id;
        this.price = price;
        this.title = title;
        this.message = message;
        this.user = user;
        this.time = time;
        this.userId = userId;
        this.messageNum = messageNum;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getUser_id() {
        return userId;
    }

    public void setUser_id(Integer userid) {
        this.userId = userid;
    }

    public ShareProduct() {
    }


    public String displayParsedDate() {
        SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(this.time);
    }


}

